@using Microsoft.Extensions.Options
@using Umbraco.Cms.Api.Management.Controllers.Security
@using Umbraco.Cms.Api.Management.Extensions
@using Umbraco.Cms.Core.Configuration.Models
@using Umbraco.Cms.Core.Logging
@using Umbraco.Cms.Core.Manifest
@using Umbraco.Cms.Core.Serialization
@using Umbraco.Cms.Web.Common.Hosting
@using Umbraco.Extensions
@inject IBackOfficePathGenerator BackOfficePathGenerator
@inject IPackageManifestService PackageManifestService
@inject IJsonSerializer JsonSerializer
@inject IProfilerHtml ProfilerHtml
@inject IOptions<GlobalSettings> GlobalSettings
@{
    bool.TryParse(Context.Request.Query["umbDebug"], out var isDebug);
    var backOfficePath = BackOfficePathGenerator.BackOfficePath;
    var backOfficeAssetsPath = BackOfficePathGenerator.BackOfficeAssetsPath;
    var loginLogoImageAlternative = Url.RouteUrl(BackOfficeGraphicsController.LoginLogoAlternativeRouteName, new {Version= "1"});
}<!doctype html>
<html lang="@GlobalSettings.Value.DefaultUILanguage">

<head>
    <meta charset="UTF-8" />
    <base href="@backOfficePath.EnsureEndsWith('/')" />
    <link rel="icon" type="image/svg+xml" href="@backOfficeAssetsPath/assets/favicon.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="mobile-web-app-capable" content="yes"/>
    <meta name="robots" content="noindex, nofollow"/>
    <meta name="pinterest" content="nopin"/>
    <title>Umbraco</title>

    <link rel="stylesheet" href="@backOfficeAssetsPath/css/umb-css.css" />
    <link rel="stylesheet" href="@backOfficeAssetsPath/css/uui-css.css" />
    @await Html.BackOfficeImportMapScriptAsync(JsonSerializer, BackOfficePathGenerator, PackageManifestService)
    <script type="module" src="@backOfficeAssetsPath/apps/app/app.element.js"></script>
</head>

<body class="uui-font uui-text" style="margin: 0; padding: 0; overflow: hidden">
<noscript>
    <style>
        #noscript-container {
            display: flex;
            flex-wrap: wrap;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
            padding: 0 20px;
            text-align: center;
        }
    </style>
    <div id="noscript-container">
        <h1 aria-hidden="true" class="uui-h3" style="display: inline-flex; align-items: center; gap: 10px">
            <img alt="logo" src="@loginLogoImageAlternative" style="width: 100%" />
        </h1>
        <p>For full functionality of Umbraco CMS it is necessary to enable JavaScript.</p>
        <p>Here are the <a href="https://www.enable-javascript.com/" target="_blank" rel="noopener" style="text-decoration: underline;">instructions how to enable JavaScript in your web browser</a>.</p>
    </div>
</noscript>
<umb-app></umb-app>

@if (isDebug)
{
    @Html.Raw(ProfilerHtml.Render())
}
</body>

</html>
